<?php declare(strict_types=1);


namespace Demo\Adapter;


class EBookAdapter implements Book
{

    // TODO: Implement getPage() method.
    protected $eBook;

    public function __construct(EBook $eBook){
        $this->eBook = $eBook;
    }

    /**
     * @desc 描述
     *
     * @param EBook $eBook
     * @author happyDong
     * @date 2021/1/18
     */
    public function getPage(): int
    {
       return  $this->eBook->getPage()[0];
    }

    public function open()
    {
        $this->eBook->unlock();
    }

    public function turnPage()
    {
       $this->eBook->pressNext();
    }
}